import datetime

from enum import Enum

class OutputProperty:
    def ToString(output):
        if isinstance(output, Enum):
            return output.name
        if type(output) is datetime.date:
            return output.isoformat()
        if output is None:
            return " "
        return str(output)
    
    def __init__(self):
        self.__owner = None
        self.__datetime = None
        self.__amount = None
        self.__currency = None
        self.__category = None
        self.__auto = False
        self.__payMethod = None
        self.__note = None
        self.__event = None

    def __iter__(self):
        self.i = 0
        return self

    def __next__(self):
        current = self.i
        self.i += 1
        collections = [self.__owner, self.__datetime, self.__amount, self.__currency, self.__category, self.__auto, self.__payMethod, self.__note, self.__event]
        if current >= len(collections):
            raise StopIteration
        return collections[current]

    @property
    def Owner(self):
        return self.__owner

    @Owner.setter
    def Owner(self, val):
        self.__owner = val

    @property
    def Datetime(self):
        return self.__datetime

    @Datetime.setter
    def Datetime(self, val):
        self.__datetime = val

    @property
    def Amount(self):
        return self.__amount

    @Amount.setter
    def Amount(self, val):
        self.__amount = val
        
    @property
    def Currency(self):
        return self.__currency

    @Currency.setter
    def Currency(self, val):
        self.__currency = val

    @property
    def Category(self):
        return self.__category

    @Category.setter
    def Category(self, val):
        self.__category = val

    @property
    def Auto(self):
        return self.__auto

    @Auto.setter
    def Auto(self, val):
        self.__auto = val

    @property
    def PayMethod(self):
        return self.__payMethod

    @PayMethod.setter
    def PayMethod(self, val):
        self.__payMethod = val

    @property
    def Note(self):
        return self.__note

    @Note.setter
    def Note(self, val):
        self.__note = val

    @property
    def Event(self):
        return self.__event

    @Event.setter
    def Event(self, val):
        self.__event = val
